package com.apptest.android.ui.architecture;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.apptest.android.R;
import com.apptest.android.core.Constants;
import com.apptest.android.core.bean.SubordinateTitleBean;

import java.util.ArrayList;
import java.util.List;

public class ArchitectureSubordinateActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_architecture_subordinate);
        initView();
    }

    private void initView(){
        Bundle bundle = getIntent().getExtras();
        TextView mTitle=findViewById(R.id.toolbar_title);
        mTitle.setText(Html.fromHtml(bundle.getString(Constants.TITLE)));
        ArchitectureSubordinateFragment subordinateFragment = new ArchitectureSubordinateFragment();
        subordinateFragment.setArguments(bundle);
        getSupportFragmentManager().beginTransaction()
                .add(R.id.architecture_subordinate_container, subordinateFragment).commit();
    }

    public static void startArchitectureSubordinateActivity(Context context, Bundle bundle){
        Intent intent = new Intent(context, ArchitectureSubordinateActivity.class);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
}
